// 重置密码
$('.layui-form').on('submit', function(ev){
    ev.preventDefault();
    let data = {
        oldPwd: md5($('.layui-form input[name=oldPwd]').val()),
        newPwd: md5($('.layui-form input[name=newPwd]').val())
    }
    let dataArr = [];
    for (key in data) {
        dataArr.push(key + '=' + data[key]);
    }
    let dataStr = dataArr.join('&');
    updatePwdAPI(dataStr, res => {
        window.parent.sessionStorage.removeItem('token');
        layer.msg(res.data.message, {
            icon: 6,
            time: 1000,
            end: function () {
                window.parent.location.href = '/login.html';
            }
        })
    });
})